﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HuynhQuangWebsite.Models.HomeAdminListViewModel>" %>
<%@ Import Namespace="THS.HtmlHelpers" %>

  <div class="widget">
        <div class="title"><img src="../../Images/adminSite/icons/dark/users.png" alt="" class="titleIcon" /><h6>Danh sách Admin</h6></div>
        <ul class="partners">
        <%if (Model != null)
          {
              if (Model.AdminList != null)
              {
                  foreach (var item in Model.AdminList)
                  {
                  %>
            <li>
                
                <div class="pInfo">
                    <a href="<%=Url.Action("Detail","ManageAdmin",new {id=item.AdminID})%>"><strong><%=item.UserName%></strong></a>
                    <i> <%=Html.Encode(HuynhQuangWebsite.Models.Utilities.AliasDictionary[item.Type])%></i>
                      <i><%=Html.CheckBox("AllowLogOn", item.AllowLogOn, new { onclick = "AllowLogOn('" + item.AdminID + "')" })%></i><label for="check1">Cho phép đăng nhập</label>
                      	
                </div>
                <div class="pLinks">
                    <a href="#" title="Direct call" class="tipW"><img src="../../Images/adminSite/icons/pSkype.png" alt="" /></a>
                    <a href="#" title="Send an email" class="tipW"><img src="../../Images/adminSite/icons/pEmail.png" alt="" /></a>
                </div>
                <div class="clear"></div>
            </li>
           <%} %>
                
        </ul>
         <div class="divider_line"></div>
					        <div class="pagination wp-pagenavi">
						       
                                    <%=Ajax.Pager(Model.AdminInfo.CurrentPage, Model.AdminInfo.TotalItems, "AdminList", 0, Model.AdminInfo.ItemsPerPage, "Paging")%>
					        </div>	
                            <%}
          } %>

             <script type="text/javascript">
                 function ConfirmActive() {
                     if (confirm("Bạn chắc chắn hiển thị toàn bộ danh sách?")===true) {
                         return true;
                     }
                     else {
                         return false;
                     }

                 }
                 function ConfirmDeActive() {
                     if (confirm("Bạn chắc chắn ẩn toàn bộ danh sách?") == true) {
                         return true;
                     }
                     else {
                         return false;
                     }

                 }
                 function ConfirmDelete() {
                     if (confirm("Bạn chắc chắn xóa?")===true) {
                         return true;
                     }
                     else {
                         return false;
                     }

                 }

                 function AllowLogOn(id) {
                     $.post("/ManageAdmin/AllowLogOn", { id: id });
                 }    
    </script>
    </div>